<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="oneroom.user.area.areaModel" %>
<%@ page import="oneroom.admin.board.boardModel" %>
<jsp:useBean id="areaDao" scope="page" 	class="oneroom.user.area.areaDao" />
<%
	String pageName = "area_list.jsp";
	String viewName = "area_view.jsp";
	String roomkind = request.getParameter("roomkind") == null ? "1" :request.getParameter("roomkind");
	List seoulList = areaDao.getSeaul(roomkind,10); 
	List keaykiList = areaDao.getKeayki(roomkind,10); 
	List roomList = areaDao.getRoom(roomkind,10);
	List boardList =  areaDao.getBoard("2");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<table>
<%for(int i=0; i<seoulList.size(); i++){ %>

<%if(i==0){ %>
<tr>
<%} %>
<%if(i%5 == 0 && i!=0){ %>
</tr>
<tr>
<%} %>
<td>
	<% areaModel model = (areaModel)seoulList.get(i);%>
	<%if(model.getPhoto1_main().equals("1")){ %>
		<img src="/download/<%=model.getPhoto1_small() %>?name=<%=model.getPhoto1_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("2")){ %>
		<img src="/download/<%=model.getPhoto2_small() %>?name=<%=model.getPhoto2_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("3")){ %>
		<img src="/download/<%=model.getPhoto3_small() %>?name=<%=model.getPhoto3_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("4")){ %>
		<img src="/download/<%=model.getPhoto4_small() %>?name=<%=model.getPhoto4_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("5")){ %>
		<img src="/download/<%=model.getPhoto5_small() %>?name=<%=model.getPhoto5_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("6")){ %>
		<img src="/download/<%=model.getPhoto6_small() %>?name=<%=model.getPhoto6_small() %>&kind=img" />
	<%} %>
	<%=model.getTitle() %>
	<%=model.getRoommoney() %>
	<%=model.getRoommonth1() %>
	<%=model.getRoommonth2() %>
	<%=model.getCreatedate() %>
	<%=model.getOneroom_seq() %>
	</td>
<%if((seoulList.size()-1)==i){ %>
</tr>
<%} %>
<%} %>
</table>


<table>
<%for(int i=0; i<keaykiList.size(); i++){ %>
<%if(i==0){ %>
<tr>
<%} %>
<%if(i%5 == 0 && i!=0){ %>
</tr>
<tr>
<%} %>
<td>
	<% areaModel model = (areaModel)keaykiList.get(i);%>
	<%if(model.getPhoto1_main().equals("1")){ %>
		<img src="/download/<%=model.getPhoto1_small() %>?name=<%=model.getPhoto1_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("2")){ %>
		<img src="/download/<%=model.getPhoto2_small() %>?name=<%=model.getPhoto2_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("3")){ %>
		<img src="/download/<%=model.getPhoto3_small() %>?name=<%=model.getPhoto3_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("4")){ %>
		<img src="/download/<%=model.getPhoto4_small() %>?name=<%=model.getPhoto4_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("5")){ %>
		<img src="/download/<%=model.getPhoto5_small() %>?name=<%=model.getPhoto5_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("6")){ %>
		<img src="/download/<%=model.getPhoto6_small() %>?name=<%=model.getPhoto6_small() %>&kind=img" />
	<%} %>
	<%=model.getTitle() %>
	<%=model.getRoommoney() %>
	<%=model.getRoommonth1() %>
	<%=model.getRoommonth2() %>
	<%=model.getCreatedate() %>
	<%=model.getOneroom_seq() %>
	</td>
<%if((keaykiList.size()-1)==i){ %>
</tr>
<%} %>
<%} %>
</table>

<table>
<%for(int i=0; i<roomList.size(); i++){ %>
<%if(i==0){ %>
<tr>
<%} %>
<%if(i%5 == 0 && i!=0){ %>
</tr>
<tr>
<%} %>
<td>
	<% areaModel model = (areaModel)roomList.get(i);%>
	<%if(model.getPhoto1_main().equals("1")){ %>
		<img src="/download/<%=model.getPhoto1_small() %>?name=<%=model.getPhoto1_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("2")){ %>
		<img src="/download/<%=model.getPhoto2_small() %>?name=<%=model.getPhoto2_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("3")){ %>
		<img src="/download/<%=model.getPhoto3_small() %>?name=<%=model.getPhoto3_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("4")){ %>
		<img src="/download/<%=model.getPhoto4_small() %>?name=<%=model.getPhoto4_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("5")){ %>
		<img src="/download/<%=model.getPhoto5_small() %>?name=<%=model.getPhoto5_small() %>&kind=img" />
	<%}else if(model.getPhoto1_main().equals("6")){ %>
		<img src="/download/<%=model.getPhoto6_small() %>?name=<%=model.getPhoto6_small() %>&kind=img" />
	<%} %>
	<%=model.getTitle() %>
	<%=model.getRoommoney() %>
	<%=model.getRoommonth1() %>
	<%=model.getRoommonth2() %>
	<%=model.getCreatedate() %>
	<%=model.getOneroom_seq() %>
</td>
<%if((roomList.size()-1)==i){ %>
</tr>
<%} %>
<%} %>
</table>

<table>
<%for(int i=0; i<boardList.size(); i++){ %>
<% boardModel model = (boardModel)boardList.get(i);%>
<tr>
<td>
<%=model.getTitle() %>
<%=model.getReg_date() %>
</td>
</tr>
<%} %>
</table>
</body>
</html>